package com.atguigu.springcloud.service;

import com.atguigu.springcloud.entities.entities.CommonResult;
import com.atguigu.springcloud.entities.entities.Payment;
import feign.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;


/**
 * 通过Feign去注册中心访问对应服务接口
 */
@Component
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")

public interface PaymentFeignService {
//    //新增业内主要写法  add save  create
//    public int create(Payment payment);
//
//    CommonResult<Payment>  getPaymentById(@Param("id") Long id );

    @GetMapping("Payment/getPaymentById/{id}")
    public CommonResult getPaymentById(@PathVariable("id") Long id);
    //测试超时
    @GetMapping("Payment/feign/timeout")
    public String PaymentFeignTimeOut();
}
